home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 47
/
Amiga Format AFCD47 (Issue 131, Xmas 1999).iso
/
-serious-
/
misc
/
fiasco_2.22
/
arexx
/
age.frx
next >
Wrap
Text File
|
1999-10-17
|
1KB
|
41 lines
/* age.frx
* ARexx script for calculating of the age using
* "Day of birth" and current date
* Copyright © 1995-1997 Nils Bandener
* $VER: age.frx 6.1 (22.9.97)
*/
Options Results
GetField "DayOfBirth" /* Insert here the field ID
* of the field, which contains
* the day of birth
*/
Date = Result
Parse Var Date GDay "." GMonth "." GYear /* ARexx makes parsing
* of the string
* very easy
*/
Parse Value Date(European) With ADay "/" AMonth "/" AYear /* The dateformat of
* ARexx is a bit diffrent
*/
if length(GYear) <= 2 then GYear = GYear + 1900 /* Years with two digits are
* supposed to be in
* the 20th century
*/
if length(AYear) <= 2 then AYear = AYear + 1900
DYear = AYear - GYear
if GMonth > AMonth then DYear = DYear - 1
else if GMonth = AMonth & GDay > ADay then DYear = DYear - 1
SetField "Age" DYear /* Insert here the correct field ID, too
*/